<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D AI动漫少女</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: linear-gradient(135deg, #FFB6C1 0%, #FF69B4 50%, #FF1493 100%);
            overflow: hidden;
        }

        #container {
            position: relative;
            width: 100vw;
            height: 100vh;
        }

        #canvas-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        #ui-panel {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(10px);
            min-width: 400px;
        }

        .input-group {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }

        #textInput {
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 25px;
            font-size: 16px;
            outline: none;
            transition: border-color 0.3s;
        }

        #textInput:focus {
            border-color: #667eea;
        }

        #speakBtn {
            padding: 12px 25px;
            background: linear-gradient(45deg, #FF69B4, #FF1493);
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 16px;
            cursor: pointer;
            transition: transform 0.2s;
        }

        #speakBtn:hover {
            transform: translateY(-2px);
        }

        #speakBtn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .status {
            text-align: center;
            color: #666;
            font-size: 14px;
            margin-top: 10px;
        }

        .loading {
            display: none;
            text-align: center;
            color: #FF69B4;
        }

        .loading.show {
            display: block;
        }

        #controls {
            position: absolute;
            top: 20px;
            right: 20px;
            background: rgba(255, 255, 255, 0.9);
            padding: 15px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        .control-group {
            margin-bottom: 10px;
        }

        .control-group label {
            display: block;
            margin-bottom: 5px;
            font-size: 12px;
            color: #666;
        }

        .control-group input[type="range"] {
            width: 100%;
        }

        #title {
            position: absolute;
            top: 20px;
            left: 20px;
            color: white;
            font-size: 24px;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        }
    </style>
</head>
<body>
    <div id="container">
        <h1 id="title">3D AI动漫少女</h1>
        
        <div id="canvas-container"></div>
        
        <div id="controls">
            <div class="control-group">
                <label>旋转速度</label>
                <input type="range" id="rotationSpeed" min="0" max="2" step="0.1" value="1">
            </div>
            <div class="control-group">
                <label>动画强度</label>
                <input type="range" id="animationIntensity" min="0" max="2" step="0.1" value="1">
            </div>
            <div class="control-group">
                <label>表情强度</label>
                <input type="range" id="expressionIntensity" min="0" max="2" step="0.1" value="1">
            </div>
        </div>
        
        <div id="ui-panel">
            <div class="input-group">
                <input type="text" id="textInput" placeholder="输入要说的内容..." maxlength="200">
                <button id="speakBtn">说话</button>
            </div>
            <div class="loading" id="loading">
                <div>正在生成语音...</div>
            </div>
            <div class="status" id="status">准备就绪</div>
        </div>
    </div>

    <script src="/socket.io/socket.io.js"></script>
    <script src="js/three.min.js"></script>
    <script src="js/gsap.min.js"></script>
    <script>
        // 检查依赖是否加载
        window.addEventListener('load', function() {
            console.log('页面加载完成');
            
            if (typeof THREE === 'undefined') {
                console.error('Three.js未加载');
                document.getElementById('status').textContent = '错误：Three.js未加载';
                return;
            }
            
            if (typeof gsap === 'undefined') {
                console.error('GSAP未加载');
                document.getElementById('status').textContent = '错误：GSAP未加载';
                return;
            }
            
            console.log('所有依赖已加载');
        });
    </script>
    <script src="js/digital-human.js"></script>
    <script src="js/app.js"></script>
</body>
</html>
